import request from '@/utils/request'

export function getDepts(params) {
  return request({
    url: 'api/dropDown/sysDeptTree',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'api/sysDept/addOrSave',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/sysDept',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/sysDept/addOrSave',
    method: 'post',
    data
  })
}

export function copy(data) {
  return request({
    url: 'api/sysDept/copy',
    method: 'post',
    data
  })
}

export function enableOrDisable(data) {
  return request({
    url: 'api/sysDept/enableOrDisable',
    method: 'post',
    data
  })
}

export function exportDe(data) {
  return request({
    url: 'api/sysDept/export',
    method: 'post',
    data
  })
}

export function importDe(data) {
  return request({
    url: 'api/sysDept/import',
    method: 'post',
    data
  })
}

export function tree(data) {
  return request({
    url: 'api/sysDept/tree',
    method: 'get',
    data
  })
}

export default { add, edit, del, getDepts, copy, enableOrDisable, exportDe, importDe, tree }
